import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:get/get.dart';
import 'package:gourmet/color/hex.dart';
import 'package:gourmet/ui/draw_under_line.dart';
import 'package:gourmet/utils/colors.dart';
import 'package:gourmet/utils/styles.dart';

class MineBillInfoController extends GetxController {}

class MineBillInfoPage extends GetView<MineBillInfoController> {
  const MineBillInfoPage({super.key});

  @override
  Widget build(BuildContext context) {
    return MediaQuery.removeViewPadding(
      context: context,
      removeBottom: true,
      removeLeft: true,
      removeRight: true,
      child: Scaffold(
        backgroundColor: Colors.white,
        appBar: AppBar(
          leading: IconButton(
            onPressed: Get.back,
            icon: Icon(
              CupertinoIcons.chevron_back,
              size: 18,
              color: HexColor(ColorsUtils.color0000),
            ),
          ),
          backgroundColor: Colors.white,
          systemOverlayStyle: SystemUiOverlayStyle.dark,
          centerTitle: true,
          title: Text(
            '账单详情',
            style: StylesUtils.customTextStyle(
              fontSize: StylesUtils.fontSize18,
              fontWeight: FontWeight.w700,
              color: ColorsUtils.color0000,
            ),
          ),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              DrawUnderLine(
                dx: 35,
                child: Container(
                  padding: const EdgeInsets.only(top: 40, bottom: 25),
                  child: Column(
                    children: [
                      Center(
                        child: Text(
                          '-￥95',
                          style: StylesUtils.customTextStyle(
                            fontSize: StylesUtils.fontSize32,
                            color: ColorsUtils.colorFf00,
                          ),
                        ),
                      ),
                      Container(
                        margin: const EdgeInsets.only(top: 15),
                        alignment: Alignment.center,
                        child: Text(
                          '交易成功',
                          style: StylesUtils.customTextStyle(
                            color: ColorsUtils.color0000,
                          ),
                        ),
                      ),
                    ],
                  ),
                ),
              ),
              Padding(
                padding: const EdgeInsets.only(top: 25, left: 25, bottom: 35),
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  crossAxisAlignment: CrossAxisAlignment.center,
                  children: [
                    Image.network(
                      'https://img2.baidu.com/it/u=925468304,3986454037&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=510',
                      width: 40,
                      height: 40,
                      fit: BoxFit.fill,
                    ),
                    Padding(
                      padding: const EdgeInsets.only(left: 10),
                      child: Text(
                        '外卖订单_华莱士-凤凰广场2店',
                        style: StylesUtils.customTextStyle(
                          fontSize: StylesUtils.fontSize16,
                          color: ColorsUtils.color0000,
                        ),
                      ),
                    ),
                  ],
                ),
              ),
              Padding(
                padding: const EdgeInsets.symmetric(horizontal: 15),
                child: Column(
                  children: [
                    SizedBox(
                      height: 40,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '订单金额',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color7979,
                              fontSize: StylesUtils.fontSize13,
                            ),
                          ),
                          Text(
                            '￥13',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color0000,
                              fontSize: StylesUtils.fontSize13,
                            ),
                          ),
                        ],
                      ),
                    ),
                    SizedBox(
                      height: 40,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '支付方式',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color7979,
                              fontSize: StylesUtils.fontSize13,
                            ),
                          ),
                          Text(
                            '微信支付',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color0000,
                              fontSize: StylesUtils.fontSize13,
                            ),
                          ),
                        ],
                      ),
                    ),
                    SizedBox(
                      height: 40,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '创建时间',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color7979,
                              fontSize: StylesUtils.fontSize13,
                            ),
                          ),
                          Text(
                            '2024-07-15 12:41:14',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color0000,
                              fontSize: StylesUtils.fontSize13,
                            ),
                          ),
                        ],
                      ),
                    ),
                    SizedBox(
                      height: 40,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '订单号',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color7979,
                              fontSize: StylesUtils.fontSize13,
                            ),
                          ),
                          Text(
                            '12232964103521',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.colorFf64,
                              fontSize: StylesUtils.fontSize13,
                            ),
                          ),
                        ],
                      ),
                    ),
                    SizedBox(
                      height: 40,
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            '交易单号',
                            style: StylesUtils.customTextStyle(
                              color: ColorsUtils.color7979,
                              fontSize: StylesUtils.fontSize13,
                            ),
                          ),
                          Text.rich(
                            TextSpan(
                              children: [
                                TextSpan(
                                  text: '1323296410352  ',
                                  style: StylesUtils.customTextStyle(
                                    color: ColorsUtils.color7979,
                                    fontSize: StylesUtils.fontSize13,
                                  ),
                                ),
                                WidgetSpan(
                                    child: Container(
                                      constraints: const BoxConstraints.expand(
                                          width: 40, height: 20),
                                      decoration: BoxDecoration(
                                        borderRadius: BorderRadius.circular(10),
                                        border: Border.all(
                                          color:
                                              HexColor(ColorsUtils.colorFf64),
                                        ),
                                      ),
                                      alignment: Alignment.center,
                                      child: Text(
                                        '复制',
                                        style: StylesUtils.customTextStyle(
                                          color: ColorsUtils.colorFf64,
                                          fontSize: StylesUtils.fontSize12,
                                        ),
                                      ),
                                    ),
                                    alignment: PlaceholderAlignment.middle),
                              ],
                            ),
                          ),
                        ],
                      ),
                    ),
                  ],
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
